import Vue from "vue";
import PosConfirm from "./PosConfirm.vue";

const Confirm = Vue.extend(PosConfirm);

function showConfirm(options) {
    const dom = new Confirm({
        el: document.createElement('div'),
        data() {
            return {
                ...options
            }
        }
    });

    // 把 实例化的 toast.vue 添加到 body 里
    document.body.appendChild(dom.$el);

    dom.show = true;
}

export default {
    install() {
        Vue.prototype.$showConfirm = showConfirm;
    }
}